package com.srunpass.algorithm;

/**
 * @author srunpass
 * @version Id: 可怜的小猪, v 0.1 2024/8/1 15:14 srunpass Exp $
 */
public class 可怜的小猪 {
    public static void main(String[] args) {
        可怜的小猪 ss = new 可怜的小猪();
        int i = ss.poorPigs(4, 2, 2);
        System.out.println(i);
    }
    public int poorPigs(int buckets, int minutesToDie, int minutesToTest) {
        int times = minutesToTest/minutesToDie;
        int status = times+1;
        int pig = 0;
        int canBucket = 1;
        while (canBucket<buckets){
            pig++;
            canBucket*=status;
        }
        return pig;
    }
}
